<!--班车座位页-->
<template>

    <div class="wrap">
        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                v-model:value="query"
                :table-loading="tableLoading"
                @search-data="searchData"
        >

            <template #hLSlot >
                <div class="tips">
                    显示条件：<br>
                    1、权限，班车管理->班车管理_营运组；<br>
                    2、班车与人员的营运组名称相同，a.班车业务->班车管理->营运组名称，b.系统数据->员工管理->营运组名称
                </div>
            </template>
        </m-page-list>
        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>

    </div>

</template>

<script setup>

  import {ref,reactive,onMounted,nextTick} from 'vue'
  import {useRouter} from 'vue-router'
  //组件
  import MPageList from '@/components/PageList'
  import MDialogForm from '@/components/DialogForm/DialogForm'
  //请求
  import {getAllShuttleSeat, addShuttleSeat,changeShuttleSeatLineName,delShuttleSeat,getSeatStatus,getTicketType,getStop,getIdentificationType} from '@/request/api/basicData'

  import {usePageList} from "../../composables/pageList";
  //引用类型字段参数
  import {refOpt} from "../const";

  const router = useRouter();

  let opts = {
    auth_id: 'shuttleSeat',
    getApi: getAllShuttleSeat,editApi:changeShuttleSeatLineName,
    idKey: 'shuttle_seat_id'
  };
  let {option,page,total,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,dialogOption
    ,searchData,getDataList,dialogConfirm,rowEdit} = usePageList(opts);

  option.conditions = [
    {label: '班车座位编号',type: 'text',field_id: 'shuttle_seat_id',col: 12   },
    {label: '班车座位名称',type: 'text',field_id: 'shuttle_seat_name',col: 12},
  ];
  option.colBtns.pop();
  // option.colBtns = [{title: '修改',width: 200,id: 'edit',type: 'primary',event: rowEdit}];
  option.hLBtns = [];
  option.cols = [
    {prop: 'shuttle_seat_id',label: '班车座位编号' },
    {prop: 'shuttle_seat_name',label: '班车座位名称' },
    {prop: 'line_name',label: '线路名' },
  ];
  dialogOption.fieldList = [
    {field_id: 'shuttle_seat_id',label: '班车座位编号',type: 'text',col: 3 ,required: true,editDisabled: true },
    {field_id: 'shuttle_seat_name',label: '班车座位名称',type: 'text',col: 3 ,required: true},
    {field_id: 'line_name',label: '线路名',type: 'text',col: 3  },
  ];

</script>

<style scoped lang="less">
    @import '../../assets/css/pageList.less';

    .wrap{
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .tips{
        color: #999;

    }
</style>
